﻿
Public MustInherit Class requestProcessor
    Private _closed As Boolean = False

    'requestProcessor needs httpContext, but may not httpServer2, so do not want it to be locked.
    Public MustOverride Function pathidentity() As String

    Public Overridable Sub initial(Optional ByVal config As configParser = Nothing)
        'do nothing here
    End Sub

    Protected Overridable Sub closeImpl()
        'do nothing here
    End Sub

    Public Sub close()
        If Not closed() Then
            closeImpl()
            setClosed()
        End If
    End Sub

    Private Sub setClosed()
        _closed = True
    End Sub

    Public Function closed() As Boolean
        Return _closed
    End Function

    Public MustOverride Function process(ByVal context As httpContext) As Boolean
End Class
